home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / AEObjects.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  20KB  |  421 lines

  1. /*
  2.      File:        AEObjects.h
  3.  
  4.      Contains:    Object Support Interfaces.
  5.  
  6.      Version:    Technology:    System 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __AEOBJECTS__
  19. #define __AEOBJECTS__
  20.  
  21. #ifndef __OSUTILS__
  22. #include <OSUtils.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __EPPC__
  28. #include <EPPC.h>
  29. #endif
  30. #ifndef __APPLEEVENTS__
  31. #include <AppleEvents.h>
  32. #endif
  33. #ifndef __ERRORS__
  34. #include <Errors.h>
  35. #endif
  36. #if FOR_SYSTEM7_ONLY
  37. #ifndef __MEMORY__
  38. #include <Memory.h>
  39. #endif
  40. #ifndef __EVENTS__
  41. #include <Events.h>
  42. #endif
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. #if PRAGMA_IMPORT_SUPPORTED
  50. #pragma import on
  51. #endif
  52.  
  53. #if PRAGMA_ALIGN_SUPPORTED
  54. #pragma options align=mac68k
  55. #endif
  56.  
  57. /****    LOGICAL OPERATOR CONSTANTS    ****/
  58.  
  59. enum {
  60.     kAEAND                        = 'AND ',                        /*  0x414e4420  */
  61.     kAEOR                        = 'OR  ',                        /*  0x4f522020  */
  62.     kAENOT                        = 'NOT ',                        /*  0x4e4f5420  */
  63.                                                                 /****    ABSOLUTE ORDINAL CONSTANTS    ****/
  64.     kAEFirst                    = 'firs',                        /*  0x66697273  */
  65.     kAELast                        = 'last',                        /*  0x6c617374  */
  66.     kAEMiddle                    = 'midd',                        /*  0x6d696464  */
  67.     kAEAny                        = 'any ',                        /*  0x616e7920  */
  68.     kAEAll                        = 'all ',                        /*  0x616c6c20  */
  69.                                                                 /****    RELATIVE ORDINAL CONSTANTS    ****/
  70.     kAENext                        = 'next',                        /*  0x6e657874  */
  71.     kAEPrevious                    = 'prev',                        /*  0x70726576  */
  72.                                                                 /****    KEYWORD CONSTANT     ****/
  73.     keyAECompOperator            = 'relo',                        /*  0x72656c6f  */
  74.     keyAELogicalTerms            = 'term',                        /*  0x7465726d  */
  75.     keyAELogicalOperator        = 'logc',                        /*  0x6c6f6763  */
  76.     keyAEObject1                = 'obj1',                        /*  0x6f626a31  */
  77.     keyAEObject2                = 'obj2',                        /*  0x6f626a32  */
  78.                                                                 /*    ... for Keywords for getting fields out of object specifier records. */
  79.     keyAEDesiredClass            = 'want',                        /*  0x77616e74  */
  80.     keyAEContainer                = 'from',                        /*  0x66726f6d  */
  81.     keyAEKeyForm                = 'form',                        /*  0x666f726d  */
  82.     keyAEKeyData                = 'seld'                        /*  0x73656c64  */
  83. };
  84.  
  85.  
  86. enum {
  87.                                                                 /*    ... for Keywords for getting fields out of Range specifier records. */
  88.     keyAERangeStart                = 'star',                        /*  0x73746172  */
  89.     keyAERangeStop                = 'stop',                        /*  0x73746f70  */
  90.                                                                 /*    ... special handler selectors for OSL Callbacks. */
  91.     keyDisposeTokenProc            = 'xtok',                        /*  0x78746f6b  */
  92.     keyAECompareProc            = 'cmpr',                        /*  0x636d7072  */
  93.     keyAECountProc                = 'cont',                        /*  0x636f6e74  */
  94.     keyAEMarkTokenProc            = 'mkid',                        /*  0x6d6b6964  */
  95.     keyAEMarkProc                = 'mark',                        /*  0x6d61726b  */
  96.     keyAEAdjustMarksProc        = 'adjm',                        /*  0x61646a6d  */
  97.     keyAEGetErrDescProc            = 'indc'                        /*  0x696e6463  */
  98. };
  99.  
  100. /****    VALUE and TYPE CONSTANTS    ****/
  101.  
  102. enum {
  103.                                                                 /*    ... possible values for the keyAEKeyForm field of an object specifier. */
  104.     formAbsolutePosition        = 'indx',                        /*  0x696e6478  */
  105.     formRelativePosition        = 'rele',                        /*  0x72656c65  */
  106.     formTest                    = 'test',                        /*  0x74657374  */
  107.     formRange                    = 'rang',                        /*  0x72616e67  */
  108.     formPropertyID                = 'prop',                        /*  0x70726f70  */
  109.     formName                    = 'name',                        /*  0x6e616d65  */
  110.                                                                 /*    ... relevant types (some of these are often pared with forms above). */
  111.     typeObjectSpecifier            = 'obj ',                        /*  0x6f626a20  */
  112.     typeObjectBeingExamined        = 'exmn',                        /*  0x65786d6e  */
  113.     typeCurrentContainer        = 'ccnt',                        /*  0x63636e74  */
  114.     typeToken                    = 'toke',                        /*  0x746f6b65  */
  115.     typeRelativeDescriptor        = 'rel ',                        /*  0x72656c20  */
  116.     typeAbsoluteOrdinal            = 'abso',                        /*  0x6162736f  */
  117.     typeIndexDescriptor            = 'inde',                        /*  0x696e6465  */
  118.     typeRangeDescriptor            = 'rang',                        /*  0x72616e67  */
  119.     typeLogicalDescriptor        = 'logi',                        /*  0x6c6f6769  */
  120.     typeCompDescriptor            = 'cmpd',                        /*  0x636d7064  */
  121.     typeOSLTokenList            = 'ostl'                        /*  0x6F73746C  */
  122. };
  123.  
  124. /* Possible values for flags parameter to AEResolve.  They're additive */
  125.  
  126. enum {
  127.     kAEIDoMinimum                = 0x0000,
  128.     kAEIDoWhose                    = 0x0001,
  129.     kAEIDoMarking                = 0x0004,
  130.     kAEPassSubDescs                = 0x0008,
  131.     kAEResolveNestedLists        = 0x0010,
  132.     kAEHandleSimpleRanges        = 0x0020,
  133.     kAEUseRelativeIterators        = 0x0040
  134. };
  135.  
  136. /**** SPECIAL CONSTANTS FOR CUSTOM WHOSE-CLAUSE RESOLUTION */
  137.  
  138. enum {
  139.     typeWhoseDescriptor            = 'whos',                        /*  0x77686f73  */
  140.     formWhose                    = 'whos',                        /*  0x77686f73  */
  141.     typeWhoseRange                = 'wrng',                        /*  0x77726e67  */
  142.     keyAEWhoseRangeStart        = 'wstr',                        /*  0x77737472  */
  143.     keyAEWhoseRangeStop            = 'wstp',                        /*  0x77737470  */
  144.     keyAEIndex                    = 'kidx',                        /*  0x6b696478  */
  145.     keyAETest                    = 'ktst'                        /*  0x6b747374  */
  146. };
  147.  
  148. /*
  149. *
  150.     used for rewriting tokens in place of 'ccnt' descriptors
  151.     This record is only of interest to those who, when they...
  152.     ...get ranges as key data in their accessor procs, choose
  153.     ...to resolve them manually rather than call AEResolve again.
  154. *
  155. */
  156. struct ccntTokenRecord {
  157.     DescType                         tokenClass;
  158.     AEDesc                             token;
  159. };
  160. typedef struct ccntTokenRecord ccntTokenRecord;
  161.  
  162. typedef ccntTokenRecord *ccntTokenRecPtr;
  163. typedef ccntTokenRecPtr *ccntTokenRecHandle;
  164. #if OLDROUTINENAMES
  165. typedef AEDesc *DescPtr;
  166. typedef DescPtr *DescHandle;
  167. #endif
  168. #if FOR_SYSTEM8_PREEMPTIVE
  169. #if FOR_PTR_BASED_AE
  170. typedef AEDesc OSLToken;
  171. typedef OSLToken *OSLTokenPtr;
  172. typedef AEDesc OSLTokenList;
  173. typedef OSLTokenList *OSLTokenListPtr;
  174. /* typedefs providing type checking for procedure pointers */
  175. /* these typedefs must be the same as the system 7 ones */
  176. /* the system 7 and system 8 callbacks can intermingle */
  177. typedef pascal OSErr (*OSLAccessorProcPtr)(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, long accessorRefcon);
  178. typedef pascal OSErr (*OSLCompareProcPtr)(DescType oper, const AEDesc *obj1, const AEDesc *obj2, Boolean *result);
  179. typedef pascal OSErr (*OSLCountProcPtr)(DescType desiredType, DescType containerClass, const AEDesc *container, long *result);
  180. typedef pascal OSErr (*OSLDisposeTokenProcPtr)(AEDesc *unneededToken);
  181. typedef pascal OSErr (*OSLGetMarkTokenProcPtr)(const AEDesc *dContainerToken, DescType containerClass, AEDesc *result);
  182. typedef pascal OSErr (*OSLGetErrDescProcPtr)(AEDesc **appDescPtr);
  183. typedef pascal OSErr (*OSLMarkProcPtr)(const AEDesc *dToken, const AEDesc *markToken, long index);
  184. typedef pascal OSErr (*OSLAdjustMarksProcPtr)(long newStart, long newStop, const AEDesc *markToken);
  185. /*-------------------------------------------------------------- PUBLIC PROCEDURES ------------------------------------------------------------------*/
  186. extern OSStatus AESetObjectCallbacks(OSLCompareProcPtr myCompareProc, OSLCountProcPtr myCountProc, OSLDisposeTokenProcPtr myDisposeTokenProc, OSLGetMarkTokenProcPtr myGetMarkTokenProc, OSLMarkProcPtr myMarkProc, OSLAdjustMarksProcPtr myAdjustMarksProc, OSLGetErrDescProcPtr myGetErrDescProcPtr);
  187.  
  188. extern OSStatus AEResolve(const AEDesc *objectSpecifier, SInt16 callbackFlags, AEDesc *theToken);
  189.  
  190. extern OSStatus AEInstallObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorProcPtr theAccessor, void *accessorRefcon, Boolean isSysHandler);
  191.  
  192. extern OSStatus AERemoveObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorProcPtr theAccessor, Boolean isSysHandler);
  193.  
  194. extern OSStatus AEGetObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorProcPtr *accessor, void **accessorRefcon, Boolean isSysHandler);
  195.  
  196. extern OSStatus AEDisposeToken(AEDesc *theToken);
  197.  
  198. extern OSStatus AECallObjectAccessor(DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *token);
  199.  
  200. /* new API */
  201. extern OSStatus AECreateTokenList(OSLTokenListPtr resultList);
  202.  
  203. extern OSStatus AEAppendToTokenList(OSLTokenListPtr theTokenList, const AEDesc *addToken);
  204.  
  205. extern OSStatus AETokenCount(const OSLTokenList *theTokenList, ItemCount *theCount);
  206.  
  207. extern OSStatus AEGetNthToken(const OSLTokenList *theTokenList, ItemCount index, OSLTokenPtr resultToken);
  208.  
  209. extern OSStatus AEPruneTokenList(ItemCount keepStart, ItemCount keepEnd, OSLTokenListPtr theTokenList);
  210.  
  211. extern OSStatus AECallObjectAccessorWithFlags(DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, SInt16 callBackFlags, AEDesc *token);
  212.  
  213. extern OSStatus AEResolveSubDesc(const AESubDesc *objectSpecifier, SInt16 callBackFlags, AEDesc *theToken);
  214.  
  215. extern OSStatus AEInstallObjectCallback(AEKeyword functionClass, ProcPtr handler);
  216.  
  217. extern OSStatus AERemoveObjectCallback(AEKeyword functionClass, ProcPtr handler);
  218.  
  219. extern OSStatus AEGetObjectCallback(AEKeyword functionClass, ProcPtr *handler);
  220.  
  221. #endif
  222. #endif
  223. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  224. #if !FOR_PTR_BASED_AE
  225. /* typedefs providing type checking for procedure pointers */
  226. typedef pascal OSErr (*OSLAccessorProcPtr)(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, long accessorRefcon);
  227. typedef pascal OSErr (*OSLCompareProcPtr)(DescType oper, const AEDesc *obj1, const AEDesc *obj2, Boolean *result);
  228. typedef pascal OSErr (*OSLCountProcPtr)(DescType desiredType, DescType containerClass, const AEDesc *container, long *result);
  229. typedef pascal OSErr (*OSLDisposeTokenProcPtr)(AEDesc *unneededToken);
  230. typedef pascal OSErr (*OSLGetMarkTokenProcPtr)(const AEDesc *dContainerToken, DescType containerClass, AEDesc *result);
  231. typedef pascal OSErr (*OSLGetErrDescProcPtr)(AEDesc **appDescPtr);
  232. typedef pascal OSErr (*OSLMarkProcPtr)(const AEDesc *dToken, const AEDesc *markToken, long index);
  233. typedef pascal OSErr (*OSLAdjustMarksProcPtr)(long newStart, long newStop, const AEDesc *markToken);
  234.  
  235. #if GENERATINGCFM
  236. typedef UniversalProcPtr OSLAccessorUPP;
  237. typedef UniversalProcPtr OSLCompareUPP;
  238. typedef UniversalProcPtr OSLCountUPP;
  239. typedef UniversalProcPtr OSLDisposeTokenUPP;
  240. typedef UniversalProcPtr OSLGetMarkTokenUPP;
  241. typedef UniversalProcPtr OSLGetErrDescUPP;
  242. typedef UniversalProcPtr OSLMarkUPP;
  243. typedef UniversalProcPtr OSLAdjustMarksUPP;
  244. #else
  245. typedef OSLAccessorProcPtr OSLAccessorUPP;
  246. typedef OSLCompareProcPtr OSLCompareUPP;
  247. typedef OSLCountProcPtr OSLCountUPP;
  248. typedef OSLDisposeTokenProcPtr OSLDisposeTokenUPP;
  249. typedef OSLGetMarkTokenProcPtr OSLGetMarkTokenUPP;
  250. typedef OSLGetErrDescProcPtr OSLGetErrDescUPP;
  251. typedef OSLMarkProcPtr OSLMarkUPP;
  252. typedef OSLAdjustMarksProcPtr OSLAdjustMarksUPP;
  253. #endif
  254.  
  255. enum {
  256.     uppOSLAccessorProcInfo = kPascalStackBased
  257.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  258.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DescType)))
  259.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const AEDesc *)))
  260.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(DescType)))
  261.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DescType)))
  262.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const AEDesc *)))
  263.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(AEDesc *)))
  264.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long))),
  265.     uppOSLCompareProcInfo = kPascalStackBased
  266.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  267.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DescType)))
  268.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const AEDesc *)))
  269.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const AEDesc *)))
  270.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Boolean *))),
  271.     uppOSLCountProcInfo = kPascalStackBased
  272.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  273.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DescType)))
  274.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DescType)))
  275.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const AEDesc *)))
  276.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long *))),
  277.     uppOSLDisposeTokenProcInfo = kPascalStackBased
  278.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  279.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(AEDesc *))),
  280.     uppOSLGetMarkTokenProcInfo = kPascalStackBased
  281.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  282.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const AEDesc *)))
  283.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DescType)))
  284.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AEDesc *))),
  285.     uppOSLGetErrDescProcInfo = kPascalStackBased
  286.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  287.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(AEDesc **))),
  288.     uppOSLMarkProcInfo = kPascalStackBased
  289.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  290.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const AEDesc *)))
  291.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const AEDesc *)))
  292.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))),
  293.     uppOSLAdjustMarksProcInfo = kPascalStackBased
  294.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  295.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  296.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  297.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const AEDesc *)))
  298. };
  299.  
  300. #if GENERATINGCFM
  301. #define NewOSLAccessorProc(userRoutine)        \
  302.         (OSLAccessorUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLAccessorProcInfo, GetCurrentArchitecture())
  303. #define NewOSLCompareProc(userRoutine)        \
  304.         (OSLCompareUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLCompareProcInfo, GetCurrentArchitecture())
  305. #define NewOSLCountProc(userRoutine)        \
  306.         (OSLCountUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLCountProcInfo, GetCurrentArchitecture())
  307. #define NewOSLDisposeTokenProc(userRoutine)        \
  308.         (OSLDisposeTokenUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLDisposeTokenProcInfo, GetCurrentArchitecture())
  309. #define NewOSLGetMarkTokenProc(userRoutine)        \
  310.         (OSLGetMarkTokenUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLGetMarkTokenProcInfo, GetCurrentArchitecture())
  311. #define NewOSLGetErrDescProc(userRoutine)        \
  312.         (OSLGetErrDescUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLGetErrDescProcInfo, GetCurrentArchitecture())
  313. #define NewOSLMarkProc(userRoutine)        \
  314.         (OSLMarkUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLMarkProcInfo, GetCurrentArchitecture())
  315. #define NewOSLAdjustMarksProc(userRoutine)        \
  316.         (OSLAdjustMarksUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLAdjustMarksProcInfo, GetCurrentArchitecture())
  317. #else
  318. #define NewOSLAccessorProc(userRoutine)        \
  319.         ((OSLAccessorUPP) (userRoutine))
  320. #define NewOSLCompareProc(userRoutine)        \
  321.         ((OSLCompareUPP) (userRoutine))
  322. #define NewOSLCountProc(userRoutine)        \
  323.         ((OSLCountUPP) (userRoutine))
  324. #define NewOSLDisposeTokenProc(userRoutine)        \
  325.         ((OSLDisposeTokenUPP) (userRoutine))
  326. #define NewOSLGetMarkTokenProc(userRoutine)        \
  327.         ((OSLGetMarkTokenUPP) (userRoutine))
  328. #define NewOSLGetErrDescProc(userRoutine)        \
  329.         ((OSLGetErrDescUPP) (userRoutine))
  330. #define NewOSLMarkProc(userRoutine)        \
  331.         ((OSLMarkUPP) (userRoutine))
  332. #define NewOSLAdjustMarksProc(userRoutine)        \
  333.         ((OSLAdjustMarksUPP) (userRoutine))
  334. #endif
  335.  
  336. #if GENERATINGCFM
  337. #define CallOSLAccessorProc(userRoutine, desiredClass, container, containerClass, form, selectionData, value, accessorRefcon)        \
  338.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSLAccessorProcInfo, (desiredClass), (container), (containerClass), (form), (selectionData), (value), (accessorRefcon))
  339. #define CallOSLCompareProc(userRoutine, oper, obj1, obj2, result)        \
  340.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSLCompareProcInfo, (oper), (obj1), (obj2), (result))
  341. #define CallOSLCountProc(userRoutine, desiredType, containerClass, container, result)        \
  342.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSLCountProcInfo, (desiredType), (containerClass), (container), (result))
  343. #define CallOSLDisposeTokenProc(userRoutine, unneededToken)        \
  344.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSLDisposeTokenProcInfo, (unneededToken))
  345. #define CallOSLGetMarkTokenProc(userRoutine, dContainerToken, containerClass, result)        \
  346.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSLGetMarkTokenProcInfo, (dContainerToken), (containerClass), (result))
  347. #define CallOSLGetErrDescProc(userRoutine, appDescPtr)        \
  348.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSLGetErrDescProcInfo, (appDescPtr))
  349. #define CallOSLMarkProc(userRoutine, dToken, markToken, index)        \
  350.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSLMarkProcInfo, (dToken), (markToken), (index))
  351. #define CallOSLAdjustMarksProc(userRoutine, newStart, newStop, markToken)        \
  352.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSLAdjustMarksProcInfo, (newStart), (newStop), (markToken))
  353. #else
  354. #define CallOSLAccessorProc(userRoutine, desiredClass, container, containerClass, form, selectionData, value, accessorRefcon)        \
  355.         (*(userRoutine))((desiredClass), (container), (containerClass), (form), (selectionData), (value), (accessorRefcon))
  356. #define CallOSLCompareProc(userRoutine, oper, obj1, obj2, result)        \
  357.         (*(userRoutine))((oper), (obj1), (obj2), (result))
  358. #define CallOSLCountProc(userRoutine, desiredType, containerClass, container, result)        \
  359.         (*(userRoutine))((desiredType), (containerClass), (container), (result))
  360. #define CallOSLDisposeTokenProc(userRoutine, unneededToken)        \
  361.         (*(userRoutine))((unneededToken))
  362. #define CallOSLGetMarkTokenProc(userRoutine, dContainerToken, containerClass, result)        \
  363.         (*(userRoutine))((dContainerToken), (containerClass), (result))
  364. #define CallOSLGetErrDescProc(userRoutine, appDescPtr)        \
  365.         (*(userRoutine))((appDescPtr))
  366. #define CallOSLMarkProc(userRoutine, dToken, markToken, index)        \
  367.         (*(userRoutine))((dToken), (markToken), (index))
  368. #define CallOSLAdjustMarksProc(userRoutine, newStart, newStop, markToken)        \
  369.         (*(userRoutine))((newStart), (newStop), (markToken))
  370. #endif
  371. /*-------------------------------------------------------------- PUBLIC PROCEDURES ------------------------------------------------------------------*/
  372. extern pascal OSErr AEObjectInit(void );
  373.  
  374. /*
  375.  Not done by inline, but by direct linking into code.  It sets up the pack
  376.   such that further calls can be via inline 
  377. */
  378. extern pascal OSErr AESetObjectCallbacks(OSLCompareUPP myCompareProc, OSLCountUPP myCountProc, OSLDisposeTokenUPP myDisposeTokenProc, OSLGetMarkTokenUPP myGetMarkTokenProc, OSLMarkUPP myMarkProc, OSLAdjustMarksUPP myAdjustMarksProc, OSLGetErrDescUPP myGetErrDescProcPtr)
  379.  THREEWORDINLINE(0x303C, 0x0E35, 0xA816);
  380.  
  381. extern pascal OSErr AEResolve(const AEDesc *objectSpecifier, short callbackFlags, AEDesc *theToken)
  382.  THREEWORDINLINE(0x303C, 0x0536, 0xA816);
  383.  
  384. extern pascal OSErr AEInstallObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP theAccessor, long accessorRefcon, Boolean isSysHandler)
  385.  THREEWORDINLINE(0x303C, 0x0937, 0xA816);
  386.  
  387. extern pascal OSErr AERemoveObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP theAccessor, Boolean isSysHandler)
  388.  THREEWORDINLINE(0x303C, 0x0738, 0xA816);
  389.  
  390. extern pascal OSErr AEGetObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP *accessor, long *accessorRefcon, Boolean isSysHandler)
  391.  THREEWORDINLINE(0x303C, 0x0939, 0xA816);
  392.  
  393. extern pascal OSErr AEDisposeToken(AEDesc *theToken)
  394.  THREEWORDINLINE(0x303C, 0x023A, 0xA816);
  395.  
  396. extern pascal OSErr AECallObjectAccessor(DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *token)
  397.  THREEWORDINLINE(0x303C, 0x0C3B, 0xA816);
  398.  
  399. #endif
  400. #endif
  401. /*-------------------------------------------------------------- END PUBLIC PROCEDURES -------------------------------------------------------*/
  402. /*-------------------------------------------------------------------------------------------------------------------------------------------------*/
  403. /*  NOTE: To check for the presence of the Object Support Library on PowerPC, use    */
  404. /*    the Gestalt selector, gestaltOSLInSystem, which is defined in Gestalt.h/p/a.    */
  405. /*-------------------------------------------------------------------------------------------------------------------------------------------------*/
  406.  
  407. #if PRAGMA_ALIGN_SUPPORTED
  408. #pragma options align=reset
  409. #endif
  410.  
  411. #if PRAGMA_IMPORT_SUPPORTED
  412. #pragma import off
  413. #endif
  414.  
  415. #ifdef __cplusplus
  416. }
  417. #endif
  418.  
  419. #endif /* __AEOBJECTS__ */
  420.  
  421.